package cn.jinjimi.app.entity.AppConfig;

import cn.jinjimi.base.preference.PreferenceManager;
import cn.jinjimi.app.bean.SharePrefKeys;

/**
 * Created by Roy
 * Date: 15/12/16
 */
public class AppAnalySettings {

    /* leanCloud统计使用 状态 */
    private boolean enable_leancloud_statistics;

    /* jinjimiSDK统计使用 状态 */
    private boolean enable_jinjimi_statistics;

    public boolean isEnable_leancloud_statistics() {
        return enable_leancloud_statistics;
    }

    public void setEnable_leancloud_statistics(boolean enable_leancloud_statistics) {
        this.enable_leancloud_statistics = enable_leancloud_statistics;
    }

    public boolean isEnable_jinjimi_statistics() {
        return enable_jinjimi_statistics;
    }

    public void setEnable_jinjimi_statistics(boolean enable_jinjimi_statistics) {
        this.enable_jinjimi_statistics = enable_jinjimi_statistics;
    }

    /* 统一处理AppSetting数据 */
    public static void handleAppSettings(AppAnalySettings appAnalySettings) {
        if (appAnalySettings != null) {
            PreferenceManager.setData(SharePrefKeys.PREF_ENABLE_LEANCLOUD_STATISTICS, appAnalySettings.isEnable_leancloud_statistics());
            PreferenceManager.setData(SharePrefKeys.PREF_ENABLE_jinjimi_STATISTICS, appAnalySettings.isEnable_jinjimi_statistics());
        }
    }
}
